package com.tulingxueyuan.sentinelnew.controller;

import com.tulingxueyuan.sentinelnew.feign.ProductFeignService;
import com.tulingxueyuan.sentinelnew.feign.StockFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author :tangweiliang
 * @date : 2023/1/11 11:35
 * 未来的你会感谢现在努力的自己
 */
@RestController
@RequestMapping("/order")
public class OrderController {

    @Autowired
    StockFeignService stockFeignService;

    @Autowired
    ProductFeignService productFeignService;

    @RequestMapping("/add")
    public String add(){
        System.out.println("下单成功!");
        String s = stockFeignService.reduct();

        String p = productFeignService.get(1);
        return "Hello Feign!"+s+p;
    }
}
